Logical connectors are frequently used to combine
relational operators, for example
w
wx < 20 && x >=
10
w
wif
( ! acceptable )
wprintf("Not
Acceptable !!\n");
NOT
!
OR
||
AND
&&
Meaning
Symbol
In C/C++ these
logical connectives employ a technique known as lazy evaluation. They
evaluate their left hand operand, and then only evaluate the right hand one
if this is required. Clearly false && anything is always false, true
|| anything is always true. In such cases the second test is not evaluated.
Not operates on
a single logical value, its effect is to reverse its state. It can be used as
follows.